package com.sun.jdk.stream;

import java.util.*;
import java.util.stream.Stream;

/**
 * Stream流的两种获取方式
 */
public class StreamTest04 {
    public static void main(String[] args) {
        
       // 对数组的一些操作
        Stream<String> a1 = Stream.of("a1", "a2", "a3");
        
        String[] arr1 = {"a1", "a2", "a3"};
        Stream<String> arr11 = Stream.of(arr1);
        
        Integer[] arr2 = {1,2,3,4};
        Stream<Integer> arr21 = Stream.of(arr2);
        arr21.forEach(System.out::println);

        // 基本数据类型是不能用的
        int[] arr3 = {1,2,3,4};
        Stream<int[]> arr31 = Stream.of(arr3);
        arr31.forEach(System.out::println);
    }
}
